import { defineStore } from "pinia";
const userData=defineStore('user_data',{
    state:()=>{
        return{
            id: "1",
            name: null,
            sex: null,
            loginname: "zpf",
            number: null,
            phone: null,
            leave: 0,
            deleted: 0,
            account: "admin",
            password: "admin"
        }
    },
    //异步逻辑方法
    actions:{
        updaUserData(data){
            this.id=data.id;
            this.name=data.name;
            this.sex=data.sex;
            this.loginname=data.loginname;
            this.number=data.number;
            this.phone=data.phone;
            this.account=data.password;
        }
    },
    //计算数据
    getters:{

    }
})
export default userData;